﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 读取web.config配置文件
{
    internal class Config
    {
        public List<ConnStr> ConnStrs { get; set; }
        public Teacher teacher { get; set; }
        public override string ToString()
        {
            string connStr = "";
            foreach (ConnStr con in this.ConnStrs)
            {
                connStr += $"连接字符串名称：{con.Name} 连接字符串：{con.ConnectionString} 使用的数据库：{con.ProviderName};\n";
            }
            return $"连接字符串：{connStr}老师名称：{teacher.Name} 老师年龄：{teacher.Age} \n" +
                $"学生名称：{teacher.Students.Name} 学生年龄：{teacher.Students.Age} \n" +
                $"学生成绩：{string.Join(",", teacher.Students.Scores)}";
        }
    }

}
